import request from '@/utils/request'

// 查询问卷结果统计列表
export function listStatistics(query) {
  return request({
    url: '/questionnaire/statistics/list',
    method: 'get',
    params: query
  })
}

// 查询问卷结果统计详细
export function getStatistics(id) {
  return request({
    url: '/questionnaire/statistics/' + id,
    method: 'get'
  })
}

// 新增问卷结果统计
export function addStatistics(data) {
  return request({
    url: '/questionnaire/statistics',
    method: 'post',
    data: data
  })
}

// 修改问卷结果统计
export function updateStatistics(data) {
  return request({
    url: '/questionnaire/statistics',
    method: 'put',
    data: data
  })
}

// 删除问卷结果统计
export function delStatistics(id) {
  return request({
    url: '/questionnaire/statistics/' + id,
    method: 'delete'
  })
}



export function fetchStatistics(questionnaireId) {
  return request({
    url: `/questionnaire/statistics/get/${questionnaireId}`,
    method: 'get'
  });
}

export function generateStatistics(questionnaireId) {
  return request({
    url: `/questionnaire/statistics/generate/${questionnaireId}`,
    method: 'post'
  });
}

export function getStatisticsId(questionnaireId) {
  return request({
    url: '/questionnaire/statistics/statistics/' + questionnaireId,
    method: 'get'
  });
}

